/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package conn;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Flia Salazar Sanchez
 */
public class ListTables {
    
    public String [] listaTablas;
    
    /**
     * 
     * @param conn 
     */
    
    public void showTables(Statement conn){
        int i = 0;
        try {
            ResultSet rs = conn.executeQuery("SHOW TABLES");
              while (rs.next()) {
                  listaTablas[i] = rs.getString("name");
                    // System.out.println(rs.getString("name") + "-> " + rs.getString("engine"));
                  i++;
              }
        } catch (SQLException ex) {
            Logger.getLogger(Conn.class.getName()).log(Level.SEVERE, null, ex);
        } 
    }
    
    /**
     * 
     * @return String[] listaTablas
     */
    public String[] listTablas(){
        return listaTablas;
    }
    
}
